package com.vinny.springbootflowable2.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenApiConfig {
    
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("报销审批流程 API")
                        .description("基于Flowable的报销审批流程系统，提供完整的报销申请、审批流程管理功能。\n\n" +
                                "主要功能：\n" +
                                "* 报销申请提交\n" +
                                "* 经理/老板审批\n" +
                                "* 流程图展示\n" +
                                "* 任务管理\n\n" +
                                "技术栈：\n" +
                                "* Spring Boot\n" +
                                "* Flowable\n" +
                                "* MyBatis\n" +
                                "* MySQL")
                        .version("v1.0.0")
                        .contact(new Contact()
                                .name("VincentLee")
                                .email("vincentlee@example.com")
                                .url("https://github.com/vincentlee"))
                        .license(new License()
                                .name("MIT License")
                                .url("https://opensource.org/licenses/MIT")))
                .components(new Components()
                        .addSecuritySchemes("session", new SecurityScheme()
                                .type(SecurityScheme.Type.APIKEY)
                                .in(SecurityScheme.In.COOKIE)
                                .name("JSESSIONID")));
    }
} 